
package com.ctshk.app.ship.controller;


import com.ctshk.common.dto.Result;
import com.ctshk.common.model.PageResponse;
import com.ctshk.common.web.support.BaseController;
import com.ctshk.rpc.ship.dto.ShipProductDTO;
import com.ctshk.rpc.ship.dto.ShipRouteDTO;
import com.ctshk.rpc.ship.dto.app.ShipRouteDataDTO;
import com.ctshk.rpc.ship.dto.app.ShipWharfDto;
import com.ctshk.rpc.ship.req.ShipProductPageReq;
import com.ctshk.rpc.ship.req.ShipRoutePageReq;
import com.ctshk.rpc.ship.req.app.RouteReq;
import com.ctshk.rpc.ship.service.IAppShipProductService;
import com.ctshk.rpc.ship.service.IShipProductService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.List;

/**
 * <p>
 * 船票产品 前端控制器
 * </p>
 *
 * @author 谢诗宏
 * @since 2021-03-05
 */
@RestController
@RequestMapping("/ship-product")
@Api(value = "船票C端接口",tags = "船票APP")
public class ShipProductController extends BaseController {

    @DubboReference
    private IAppShipProductService iAppShipProductService;

    @ApiOperation(value = "PC-APP首页码头初始化", notes = "PC-APP首页码头主数据接口")
    @PostMapping(value = "/pc/init-route")
    public Result<List<ShipWharfDto>> initRoute() {
        return iAppShipProductService.initRoute();
    }

    @ApiOperation(value = "PC-APP首页码头主数据接口", notes = "PC-APP首页码头主数据接口")
    @PostMapping(value = "/pc/get-route-list")
    public Result<List<ShipWharfDto>> getRouteList(@RequestBody @Valid RouteReq req) {
        return Result.success(iAppShipProductService.queryRouteInfo(req));
    }

}
